package com.rjs.server;

import java.io.IOException;
import java.rmi.AlreadyBoundException;
import java.rmi.Naming;
import java.rmi.registry.LocateRegistry;
import java.rmi.server.RMISocketFactory;

import com.rjs.service.HelloService;
import com.rjs.service.impl.HelloServiceImpl;

public class ServerMain {

	public static void main(String[] args) throws AlreadyBoundException, IOException {
		LocateRegistry.createRegistry(8081);
		RMISocketFactory.setSocketFactory(new CustomerSocketFactory());
		HelloService helloService = new HelloServiceImpl();
		Naming.bind("rmi://localhost:8081/helloService", helloService);
		System.out.println("ServerMain provide RPC service now");
	}
}
